export const handleFunction = (res: any, error: any, response: any) => {
  if (!error) { res.json(response); }
  else { res.json(error); }
}

// 给请求参数设置默认值
export const handleQueryDefaultValueOfOne = (req: any, tag: any, defaultParams: any) => {
  req.query[tag] || (req.query[tag] = defaultParams)
}
export const handleQueryDefaultValue = (req: any, defaultValueObject: { [key: string]: any }) => {
  Object.keys(defaultValueObject).forEach((item) => {
    req.query[item] || (req.query[item] = defaultValueObject[item])
  })
}




